package com.markerhub.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.markerhub.common.enums.ComEnums;
import com.markerhub.entity.TWarnPhone;
import com.markerhub.mapper.TWarnPhoneMapper;
import com.markerhub.service.ITWarnPhoneService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 预警监控表 服务实现类
 * </p>
 *
 * @author zhz
 * @since 2021-09-18
 */
@Service
public class TWarnPhoneServiceImpl extends ServiceImpl<TWarnPhoneMapper, TWarnPhone> implements ITWarnPhoneService {

    @Override
    public void enable(String id) {
        TWarnPhone tWarnPhone = baseMapper.selectById(id);
        if(null != tWarnPhone){
            tWarnPhone.setWarnState(ComEnums.ENABLE.getCode());
            baseMapper.updateById(tWarnPhone);
        }
    }

    @Override
    public void disable(String id) {
        TWarnPhone tWarnPhone = baseMapper.selectById(id);
        if(null != tWarnPhone){
            tWarnPhone.setWarnState(ComEnums.DISABLE.getCode());
            baseMapper.updateById(tWarnPhone);
        }
    }
}
